package ch.simplix.android.net.discoverer.gsm;

import java.util.Vector;


/**
 * Describes a measurement containing several readings from the bluetooth-Discoverer
	@author SimpliX
 */
public class GSMMeasurement {

	
	

	/* time of measurment */
	protected long timestamp = 0;
	
	/* set of GSMReading readings that where taken during the measurement */
	protected Vector<GSMReading> gsmReadings;

	/* constructor */
	public GSMMeasurement() {
		this(new Vector<GSMReading>());
		
	}
	
	public GSMMeasurement(Vector<GSMReading> gsmReadings) {
		timestamp = System.currentTimeMillis();		
		this.gsmReadings = gsmReadings;
	}


	/* ************ Getter and Setter Methods ************ */

	/**
	 * @return the timestamp
	 */
	public long getTimestamp() {
		return timestamp;
	}

	/**
	 * @param timestamp
	 *            the timestamp to set
	 */
	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	
	/**
	 * @return the gsm readings
	 */
	public Vector<GSMReading> getGSMReadings() {
		return gsmReadings;
	}
	public void setGSMReadings(Vector<GSMReading> gsmReadings) {
		this.gsmReadings = gsmReadings;
	}

	public void addGSMReading(GSMReading gsmReading) {
		this.gsmReadings.addElement(gsmReading);
	}
	@Override
	public String toString() {
		String toString="";		
		if(gsmReadings!=null)
			for(GSMReading gsmReading:this.gsmReadings)
			{
				toString+=gsmReading+"\n";
			}
		
		return toString;
	}
}
